package group2.service;

import group2.model.ReceiveAddress;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author 薛献军
 * @date 2020/8/25 19:31
 */
public interface IReceiveAddressService {

    /**
     <!--查询默认地址-->
     */
    int selectDefault(String userId);

    /**
     * 查询地址信息
     * @param userId
     * @return
     */
    ReceiveAddress selectById(String userId);

    /**
     * 添加默认地址
     */
    void addAddressYes(ReceiveAddress receiveAddress, String userId);


    /**
     *添加普通地址
     */
    void addAddressNo(ReceiveAddress receiveAddress, String userId);

    /**
     * 更新为默认地址
     */
    void updateAddressYes(int addressId, String userId);


    /**
     * 更新为普通地址
     */
    void updateAddressNo(int addressId);

    /**
     * 查看所有地址
     */
    List<ReceiveAddress> selectAllAddress(String userId);

    /**
     * 删除地址
     */
    void delectAddress(int addressId);

    /**
     * 更改地址信息
     * @param receiveAddress
     */
    void updateAddress(ReceiveAddress receiveAddress);
}
